using System;
using System.Collections.Generic;
using System.Text;
using AllegNet;

namespace DemonHunter
{
    class Portal : Entity
    {
        private static Bmp myBitmap;

        public override void DoXIncrease() { }
        public override void animate() { }
        
        // check to see if player has moved through portal
        public override void move()
        {
            PlayerCharacter player = PlayerCharacter.GetInstance();

            if (player.getEntityXLoc() >= entityXLoc)
            {
                Logic.GetInstance().StartNextLevel();
                Level.GetInstance().RemoveEntity(this);
            }
        }

        public Portal()
        {
            entityXLoc = Logic.GetInstance().GetXLoc() + 1024 + myBitmap.Width;
            entityYLoc = 300;
        }

        public new static void LoadBitmaps()
        {
            myBitmap = Game.GetInstance().LoadBitmap("C:\\demonhunterart\\props\\portal.bmp");
        }

        public override Bmp GetCurrentBitmap()
        {
            return myBitmap;
        }

        public override double GetCurrentBitmapHeight()
        {
            return myBitmap.Height;
        }
    }
}
